import {SQLX} from "go/sqlx"
const db=new SQLX("duckdb","?access_mode=READ_WRITE&allow_unsigned_extensions=true")
console.log(db.query("SELECT current_setting('access_mode')"))
console.log(db.exec("SET extension_directory= './extensions'"))
console.log(db.exec("INSTALL postgres"))
console.log("install done")
console.table(db.query("FROM duckdb_extensions()"))
console.table(db.query("SELECT name,abbrev from pg_timezone_names() ORDER BY name"))
console.log(db.exec("ATTACH 'dbname=profits user=medtree password=medtree2345678 host=192.168.8.94 port=65433' AS pg (TYPE postgres)"))
console.log("attach done")
console.log(db.exec("USE pg"))
console.log("use done")
console.log(db.query("select * from pg.fact_profit limit 1"))
db.close()

